﻿Imports System
Imports System.IO
Imports System.Xml
Imports System.Xml.Schema
Imports System.Xml.Serialization

''' <summary>
''' Setar os Atributos dos Cliente 
''' </summary>
''' <remarks></remarks>
<Serializable()> _
Public Class ClienteInfo
    Inherits fornercedorInfo

    Public Sub New()

    End Sub
    Public Sub New(ByVal id As Integer, ByVal nome As String, ByVal ClienteTipo As String,
                  ByVal Email As String, ByVal dtcadastro As DateTime)
        Me.id = id
        Me.nomecliente = nome
        Me.tipocliente = ClienteTipo
        Me.email = Email
        Me.dt_cadastro = dtcadastro



    End Sub

    Private _nomecliente As String
    Private _tipocliente As String


    Public Property nomecliente() As String
        Get
            Return _nomecliente
        End Get

        Set(ByVal value As String)
            If value Is Nothing Then
                value = Convert.ToString(DBNull.Value)
                _nomecliente = value
            Else
                _nomecliente = value
            End If


        End Set
    End Property

    Public Property tipocliente() As String
        Get
            Return _tipocliente
        End Get
        Set(ByVal value As String)

            If value Is Nothing Then
                value = Convert.ToString(DBNull.Value)
                _tipocliente = value
            Else
                _tipocliente = value
            End If

        End Set
    End Property


    Private _telefones As New List(Of TelefoneInfo)

    <XmlArray(ElementName:="Telefones", IsNullable:=False), XmlArrayItem("Telefone", GetType(TelefoneInfo))> _
    Public Property telefones() As List(Of TelefoneInfo)
        Get
            Return _telefones
        End Get
        Set(ByVal value As List(Of TelefoneInfo))
            _telefones = value
        End Set
    End Property


    Private _idtipocliente As Nullable(Of Integer)
    Public Property idtipocliente() As Nullable(Of Integer)
        Get
            Return _idtipocliente

        End Get
        Set(ByVal value As Nullable(Of Integer))
            _idtipocliente = value


        End Set
    End Property

    <XmlIgnore()> _
    Public ReadOnly Property idtipoclienteSpecified() As Boolean
        Get
            Return (idtipocliente IsNot Nothing And idtipocliente.HasValue)
        End Get
    End Property


End Class
